package com.asset.dispoal.address;

import com.asset.dispoal.address.api.ConvertAreaCodeService;
import com.asset.dispoal.address.dto.ConvertAreaCodeRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tech.mhuang.pacebox.springboot.protocol.Result;


@RestController
@Api(value = "行政区号变更管理", tags = "行政区号变更管理")
@RequestMapping("gb/convertAreaCode")
public class ConvertAreaCodeController {

    @Autowired
    ConvertAreaCodeService convertAreaCodeService;

    @PostMapping("insert")
    @ApiOperation(value = "添加地址", notes = "添加地址")
    public Result insert(@RequestBody ConvertAreaCodeRequest request) {
        convertAreaCodeService.insert(request);
        return Result.ok();
    }


    @GetMapping("delete")
    @ApiOperation(value = "删除地址", notes = "删除地址")
    public Result delete(String id) {
        convertAreaCodeService.delete(id);
        return Result.ok();
    }

    @GetMapping("queryAll")
    @ApiOperation(value = "查询全部地址", notes = "查询全部地址")
    public Result queryAll() {
        return convertAreaCodeService.queryAll();
    }
}
